package org.smvcd1.controller1;

import org.smvcd1.pojo.UserInfo;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.ArrayList;
import java.util.List;

@Controller
@RequestMapping("/test6")
//@Scope("prototype")
public class Test6Controller {
    List<UserInfo> list;

    @RequestMapping("/list")
    public String list(Model model){
        list=new ArrayList<UserInfo>();
        list.add(new UserInfo("张飞"));
        list.add(new UserInfo("曹操"));
        list.add(new UserInfo("小乔"));
        model.addAttribute("list",list);

        return "/test6_list";


    }



}
